Data stored in a memory, such as a flash memory, may cause wearing of the memory. For example, programming flash memory cells to have a high threshold voltage may cause faster wearing of the cells as compared to programming the cells to a lower threshold voltage or retaining the cells in an erased state. If data to be stored is compressible, the data may be compressed and the compressed data may be encoded prior to storage to generate encoded data that causes less memory wear. For example, the encoded data may use a greater proportion of data values that are represented using low threshold voltages and a lesser proportion of data values that are stored using high threshold voltages. However, performing compression and encoding of input data in a data storage device introduces latencies when reading data and when writing data. In addition, performing compression and encoding of input data in a data storage device may increase power consumption of the data storage device and may increase a cost of manufacture of the data storage device.